import React, { useRef } from 'react'

export default function Search({getKeyword}) {
    let inputRef = useRef();
    return (
        <section className="jumbotron">
            <h3 className="jumbotron-heading">Search Github Users</h3>
            <div>
                <input type="text" placeholder="enter the name you search" ref={inputRef}/>
                <button onClick={()=>{
                    getKeyword(inputRef.current.value.trim());
                }}>Search</button>
            </div>
        </section>
    )
}
